perm filename VERCH.PN[S,DOC]2 blob
sn#647436 filedate 1982-03-16 generic text, type T, neo UTF8
User's Guide to VERCH
VERCH is a program that can be used to change back and forth between
different versions of a Pascal program. It removes and inserts comments marks
into blocks of code in Pascal programs according to flags that are set in
comments in the program itself. The syntax originally came from Dick Sites.
At SAIL, Type "R LVERCH" if you are using the system Pascal, or
"R VERCH", if you are using Hedrick Pascal.
Note that the output file can be the same as the input file.
A version command line begins with the characters "(*%" followed by one
of the following commands: SETT, SETF, IFT, IFF, ELSE, ENDC, followed by a flag
name. Spaces and tabs can be used freely, and comments added after the last
part of the command.
(*% SETT S1 *) set flag "S1" to "true"
(*% SETF S1 *) set flag "S1" to "false"
(*% IFT S1 *) if flag "S1" true then don't comment out this block
(*% IFF S1 *) if flag "S1" false then don't comment out this block
(*% ELSE *) begin reverse block
(*% ENDC *) end of block
"AND" and "OR" can be used to concatenate IFF and IFT commands:
(*% IFT S1 OR IFT VAX *) if either flag is true, the don't comment out block
An example: suppose we had a front-end compiler that was used for
both the Dec-10 and the Vax. It is currently version-changed for the Dec-10,
and we want to change it to the Vax version. Here is a section of the program
before and after running it through VERCH:
BEFORE: ************************************************************
(*%SETF D10*)
(*%IFT D10*)
Wordsize = 36;
Addrunit = 36;
(*%ELSE*)
%\
% Wordsize = 32;\
% Addrunit = 8;\
%\
(*%ENDC*)
AFTER: *************************************************************
(*%SETF D10*)
(*%IFT D10*)
%\
% Wordsize = 36;\
% Addrunit = 36;\
%\
(*%ELSE*)
Wordsize = 32;
Addrunit = 8;
(*%ENDC*)
Blocks may be nested. The AND function is performed on nested blocks.
In other words, if any of the blocks containing a statement are "false" blocks,
the statement is commented out.